home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7147 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: calloc help needed
  5. Date: Sat, 17 Feb 96 22:36:51 GMT
  6. Organization: none
  7. Message-ID: <824596611snz@genesis.demon.co.uk>
  8. References: <1996Feb15.125431.7751@leeds.ac.uk> <4g2vlq$n4k@spanky.pls.ov.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4g2vlq$n4k@spanky.pls.ov.com>
  15.            glenn@ov.com "Fletcher.Glenn@ov.com" writes:
  16.  
  17. >One side effect of calloc() is that the memory set aside is initialized to
  18. >all zeroes.
  19.  
  20. That is all-bits-zero internal representation. That doesn't imply that a
  21. pointer will be null or a floating point number will be 0.0.
  22.  
  23. ...
  24.  
  25. >void *calloc(unsigned nelem, unsigned elsize);
  26.  
  27. The ANSI prototype is:
  28.  
  29. void *calloc(size_t nelem, size_t elsize);
  30.  
  31. >From the above you can tell that the function returns a pointer of undetermined
  32. >type.
  33.  
  34. It returns a pointer of type void * which is a precisely determined type in
  35. C. However you can convert that pointer implicitly to a pointer to any type
  36. other than a function.
  37.  
  38. -- 
  39. -----------------------------------------
  40. Lawrence Kirby | fred@genesis.demon.co.uk
  41. Wilts, England | 70734.126@compuserve.com
  42. -----------------------------------------
  43.